package com.ruoyi.health.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.health.domain.Concern;
import com.ruoyi.health.service.IConcernService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * 关注养老资源 Controller
 *
 * @author libin
 * @date 2023-08-15
 */
@RestController
@RequestMapping("/health/healthConcern")
public class ConcernController extends BaseController {

    @Autowired
    private IConcernService concernService;


    /**
     * [关注]列表
     */
    @PreAuthorize("@ss.hasPermi('health:healthUser:query')")
    @GetMapping("/list/{userId}")
    public TableDataInfo listByUserId(@PathVariable Long userId) {
        //【注意，这里要获取的是前台用户的 id】
        // Long frontUserId = getUserId();  //获取当前用户 id

        return getDataTable(concernService.selectConcernWithResourceByUserId(userId));
    }

}
